<template>
<div class="page">
  <div class='nav'>
    <div class="input_view flex_ac" @click="$back() ">
      <van-icon class="ml6" name="arrow-left" size="26" color="#000"/>
      <div class="nav_title">修改手机号</div>
    </div>
	</div>
	<div class="h40"></div>
	<div class="iii">
		<div class="item">手机号<div class="right">
			<input class="input" v-model="mobile" type="text" placeholder="请输入手机号">
		</div></div>
		
		<div class="item">
			验证码
			<div class="flex_sb right1">
				<input class="input1" v-model="code" type="text" placeholder="请输入验证码">
				<div class="btn" :class="num>0?'btn_n':''" @click="send">{{num?num+'s后请重试':'获取验证码'}}</div>
			</div>
		</div>
	</div>
	
	<div class="submit" :class="!code?'submit_n':''">
		验证
	</div>
</div>
</template>

<script>
	export default {
		data() {
			return {
				mobile:'',
				code:'',
				num:0,
			}
		},
		methods: {
			send(){
				if(this.mobile&&this.mobile.length==11){
					this.num = 60
					let time = setInterval(()=>{
						if(this.num>0){
							this.num = this.num - 1
						}else{
							clearInterval(time)
						}
					},1000)
				}else{
					this.$toast({
						message:'请输入正确的手机号'
					})
				}
			}
		}
	}
</script>

<style scoped lang="scss">
.nav{
	width: 100%;
	position: fixed;
	top: 0;
	left: 0;
  height: 40px;
	background-color: rgba($color: #fff, $alpha: 1);
	z-index: 10;
	transition: all 0.5s;
}
.input_view{
	width: 100%;
  height: 100%;
	.nav_title{
		font-weight: 500;
		font-size: 18px;
		color: #000;
	}
}
.page{
	background: #F4F4F4;
	height: 100%;
	width: 100%;
}
.iii{
	margin:5px;
}
.item{
	padding: 14px 10px;
	background-color: #fff;
	position: relative;
	margin-bottom: 1px;
	display: flex;
	font-size: 16px;
	color: #000000;
	justify-content: space-between;
	.right{
		width: 70%;
		text-align: right;
		font-size: 14px;
		color: #666666;
	}
	.right1{
		width: 70%;
		font-size: 14px;
		color: #666666;
	}
	.input{
		text-align: right;
	}
	
	.btn{
		height: 27px;
		line-height:27px;
		width: 90px;
		text-align: center;
		font-size: 12px;
		color: #FFFFFF;
    background: linear-gradient(-62deg, #EB7418, #F6A15F);
		border-radius: 14px;
	}
	.btn_n{
    background: #E6E6E6;
    box-shadow: 0px 1px 2px 0px rgba(0,0,0,0.28);
		color: #999999;
	}
}
input{
  width: calc(100% - 100px);
  border: none;
}
.submit{
	position: fixed;
	left:15px;
	bottom:35px;
	width:calc(100% - 30px);
	height: 44px;
	line-height:44px;
	text-align: center;
  background: linear-gradient(-62deg, #EB7418, #F6A15F);
	border-radius: 22px;
	font-size: 18px;
	color: #FFFFFF;
}
.submit_n{
	background: #EB741888;
	color: #E6E6E6;
}
</style>
